package com.czxy.demo04;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by hp on 2020/2/1.
 */
public class Test20 {
    public static void main(String[] args) throws IOException {
        String s = FileUtils.readFileToString(new File("data.txt"), "UTF-8");
        Set<Character> set = new HashSet<>();
        for (int i = 0; i < s.length(); i++) {
            set.add(s.charAt(i));
        }
        String ss = "";
        for (Character c : set) {
            ss+=c+"";
        }
        FileUtils.writeStringToFile(new File("result.txt"),ss,"UTF-8",false);
        System.out.println("欧了");
    }
}
